﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Tag="Layout: DockPanel with WrapPanel Page">
    <UserControl.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="32" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </UserControl.Resources>
    <DockPanel LastChildFill="True" MinHeight="192">
        <Grid DockPanel.Dock="Left"
            Background="Chartreuse"
            Width="128">
            <TextBlock
                Text="DockPanel.Dock=&quot;Left&quot;"
                TextAlignment="Center">
                <TextBlock.LayoutTransform>
                    <RotateTransform CenterX=".5" CenterY=".5" Angle="-90" />
                </TextBlock.LayoutTransform>
            </TextBlock>
        </Grid>
        <Grid DockPanel.Dock="Bottom"
            Background="Aquamarine"
            Height="96">
            <TextBlock Text="DockPanel.Dock=&quot;Bottom&quot;" />
        </Grid>
        <Grid DockPanel.Dock="Right"
            Background="Azure">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" MaxHeight="512" MinHeight="216" />
                <RowDefinition Height="16" />
            </Grid.RowDefinitions>
            <TextBlock
                HorizontalAlignment="Right"
                Text="DockPanel.Dock=&quot;Right&quot;"
                TextAlignment="Right"
                />
            <WrapPanel Height="Auto" MaxHeight="512" Orientation="Vertical">
                <WrapPanel.Resources>
                    <Style TargetType="Rectangle">
                        <Setter Property="Fill" Value="Black" />
                        <Setter Property="Height" Value="60" />
                        <Setter Property="Margin" Value="4" />
                        <Setter Property="Opacity" Value="0.5" />
                        <Setter Property="Width" Value="60" />
                    </Style>
                </WrapPanel.Resources>
                <Rectangle /> <Rectangle /> <Rectangle /> <Rectangle />
                <Rectangle /> <Rectangle /> <Rectangle /> <Rectangle />
                <Rectangle /> <Rectangle /> <Rectangle /> <Rectangle />
                <Rectangle /> <Rectangle /> <Rectangle /> <Rectangle />
            </WrapPanel>
            <GridSplitter Grid.Row="1" Grid.ColumnSpan="1"
                Background="#FF333333"
                HorizontalAlignment="Stretch" VerticalAlignment="Top"
                Margin="0"
                Width="Auto" Height="16"
                />
        </Grid>
    </DockPanel>
</UserControl>
